include('codergege.js');

window.onload = function() {

	// 查找字符串中出现最多次数的字符, 及个数

	var str = 'asdklfj;asgjasdjlkfjaksdfhsdajfgklsadjfklsjdafkj';
	var arr = str.split('');
	str = arr.sort().join('');

	var re = /(\w)\1+/g;

	var count = 0;
	var value = '';
	str.replace(re, function($0, $1) {
		if(count < $0.length) {
			count = $0.length;
			value = $1;
		}
	});

	alert('重复最多的字符是: ' + value + ', 重复次数: ' + 
		count);

};

function include(path){ 
	var a=document.createElement("script");
	a.type = "text/javascript"; 
	a.src=path; 
	var head=document.getElementsByTagName("head")[0];
	head.appendChild(a);
}




